<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<div class="container_16">
    <table cellpadding="0" cellspacing="0" border="0" class="display" id="users">
        <thead>
        <tr>
            <th>Логин</th>
            <th>E - mail</th>
            <th>Телефон</th>
            <th>Заказы</th>
            <th>Действие</th>
        </tr>
        </thead>

        <tbody>
        <c:forEach var="user" items="${users}">
            <tr id="user_${user.idUser}">
                <td>${user.login}</td>
                <td>${user.email}</td>
                <td>${user.phone}</td>

                <td>
                    <a href="javascript:void(0);" title="Заказы" id="viewOrder"
                       onclick="viewUserOrder('${user.idUser}')">
                        <img src="/img/icons/edit_icon.png" alt="Заказы"/>
                    </a>

                    <br/>

                    <table cellpadding="0" cellspacing="0" border="0" class="display" style="display: none;"
                           id="order_${user.idUser}">
                        <thead>
                        <tr>
                            <th>Количество</th>
                            <th>Название</th>
                            <th>Изображение</th>
                            <th>Дата</th>
                        </tr>
                        </thead>

                        <tbody>
                        <c:forEach var="order" items="${user.userOrders}">
                            <tr>
                                <td>${order.amount}</td>
                                <td>${order.lantern.description}</td>
                                <td>
                                    <a href="#" class="dev_img"><img
                                            src="${order.lantern.imgUrl}"
                                            alt="${order.lantern.imgUrl}"
                                            width="60px;"/></a></td>
                                </td>

                                <td>${order.date}</td>
                            </tr>
                        </c:forEach>
                        </tbody>

                    </table>
                </td>

                <td>
                    <a href="javascript:void(0);" onclick="removeUser('${user.idUser}')" title="Удалить"
                       id="deleteUser">
                        <img src="/img/icons/delete_icon.png" alt="X"/>
                    </a>
                </td>

            </tr>
        </c:forEach>
        </tbody>
    </table>

</div>




